<extend name="Public/base"/>

<block name="body">
  <!-- 标题 -->
  <div class="main-title">
    <h2>{$meta_title}</h2>
  </div>
  
  <form action="{:U('editNav')}" method="post" class="form-horizontal">
    <div class="form-item">
      <label class="item-label">导航名称</label>
      <div class="controls">
        <input type="text" class="text input-large" name="title" value="{$data.title}">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">排序<span class="check-tips">（越大越靠前）</span></label>
      <div class="controls">
        <input type="text" class="text input-large" name="sort" value="{$data.sort}">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">是否显示</label>
      <div class="controls">
        <label class="radio"><input type="radio" value="1" name="is_show">是</label>
        <label class="radio"><input type="radio" value="0" name="is_show">否</label>
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">导航外链URL<span class="check-tips">（请填写包含http://的完整URL地址,如果填写此项则点击该导航会跳转到外链）</span></label>
      <div class="controls">
        <input type="text" class="text input-large" name="url" value="{$data.url}">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">新窗口打开</label>
      <div class="controls">
        <label class="radio"><input type="radio" value="1" name="new_open">是</label>
        <label class="radio"><input type="radio" value="0" name="new_open">否</label>
      </div>
    </div>
    <div class="form-item">
      <input type="hidden" name="id" value="{$data.id}">
      <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
      <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
    </div>
  </form>
</block>

<block name="script">
<script src="__JS__/jquery/jquery.loadtype.js"></script>
  <script type="text/javascript">
    /*导航高亮*/
    highlight_subnav('{:U("nav")}');
    
  //设置单选，复选，下拉菜单的值
    Core.setValue('new_open', '{$data.new_open|default = 0}');
    Core.setValue('is_show', '{$data.is_show|default = 1}');
  </script>
</block>
